<script setup lang="ts">
import { onMounted } from 'vue';

const { logo = 'vite.svg', title = '暂未定义标题' } = defineProps([
  'logo',
  'title',
]);
onMounted(() => {
  setLogo();
  setTitle();
});

/**
 * 设置网页 logo
 */
function setLogo() {
  const link = document.createElement('link');
  link.rel = 'icon';
  link.type = 'image/png';
  link.href = logo;
  document.head.appendChild(link);
}

/**
 * 设置网页标题
 */
function setTitle() {
  const t = document.createElement('title');
  t.text = title;
  document.head.appendChild(t);
}
</script>

<template></template>

<style scoped></style>
